package com.eight.teacher.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eight.common.pojo.EduTeacher;
import com.eight.common.pojo.TbCheckTeacher;
import com.eight.common.vo.Result;
import com.eight.teacher.service.CheckTeacherService;
import com.eight.teacher.vo.EduTeacherVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: qy8-education
 * @description: CheckTeacherController
 * @author: 韩宗耀
 * @create: 2023-05-27 21:47
 **/
@RestController
@RequestMapping("/teacher/checkTeacher")
@Api("讲师审核")
public class CheckTeacherController {
    @Resource
    private CheckTeacherService checkTeacherService;

    @PostMapping("/findTeacherCheck/{pageCurrent}/{pageSize}")
    @ApiOperation(value = "查询所有讲师/分页/模糊/审核")
    public Result findTeacherCheck(
            @PathVariable Integer pageCurrent,
            @PathVariable Integer pageSize,
            @RequestBody EduTeacherVo eduTeacherVo
    ){
        IPage<TbCheckTeacher> teacherCheck = checkTeacherService.findTeacherCheck(pageCurrent, pageSize, eduTeacherVo);
        return new Result(200,"查询成功",teacherCheck);
    }

    @PostMapping("/changeTeacherCheck")
    @ApiOperation("修改讲师审核信息")
    public Result changeTeacherCheck(@RequestBody TbCheckTeacher tbCheckTeacher){
        Integer teacherCheck = checkTeacherService.changeTeacherCheck(tbCheckTeacher);
        return new Result(200,"修改成功",teacherCheck);
    }
}
